package managerGUI;

import java.io.File;

import javax.swing.JFileChooser;

import managerService.ManagerSystem;

public class SetPathPopup {
	
	public SetPathPopup(){
		final JFileChooser fc = new JFileChooser();
		fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		fc.setCurrentDirectory(new File(ManagerSystem.getService().getProjectXMLPath()));
		fc.setDialogTitle("Project XMl path?");
		fc.setApproveButtonText("Set");
		if (fc.showOpenDialog(MainInterface.instance) == JFileChooser.APPROVE_OPTION) 
			ManagerSystem.getService().setProjectXMLPath(fc.getSelectedFile().getAbsolutePath());
		
		final JFileChooser fc2 = new JFileChooser();
		fc2.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		fc2.setCurrentDirectory(new File(ManagerSystem.getService().getTypeXMLPath()));
		fc2.setDialogTitle("Type XMl path?");
		fc2.setApproveButtonText("Set");
		if (fc2.showOpenDialog(MainInterface.instance) == JFileChooser.APPROVE_OPTION) 
			ManagerSystem.getService().setTypeXMLPath(fc2.getSelectedFile().getAbsolutePath());
	}
	
}
	

